package com.neo.subscribe;

import com.neo.subscribe.stamp.service.StampService;
import com.neo.subscribe.wechat.service.StampMessageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("test")
public class TestController {

    @Autowired
    private StampService stampService;

    @Autowired
    private StampMessageService stampMessageService;


    @PostMapping("spiderStampList")
    public String spiderStampList(){
        stampService.spiderStampList();
        return "success";
    }

    @PostMapping("sendStampMessage/{openId}")
    public String sendStampMessage(@PathVariable("openId") String openId) {
        stampMessageService.sendStampMessage(openId);
        return "success";
    }


    @PostMapping("sendStampMassage")
    public String sendStampMassage() {
        stampMessageService.sendStampMassage();
        return "success";
    }
    
    @PostMapping("getMessage")
    public String getMessage(){
        return stampService.assembleMessage();
    }
}
